<?php

//decode by http://www.yunlu99.com/
namespace Atm\Controller;

use Think\Controller;
class IndexController extends CommonController
{
	public function index()
	{
		$this->display();
	}
	public function top()
	{
		$this->display();
	}
	public function cleardata()
	{
		dir_del('./Uploads/daili/');
		dir_del(APP_PATH . '/Runtime/');
		M()->execute('TRUNCATE __SYS_LOG__');
		$this->success('成功', U('center'), 1);
	}
	public function ajaxclear()
	{
		$_var_0 = md5(md5(I('upass1')));
		$_var_1 = session('adminid');
		$_var_2 = M('sys_user')->where(array('id' => $_var_1))->find();
		if ($_var_2 && $_var_2['upass'] == $_var_0) {
			M()->execute('TRUNCATE __SAOLEI_LINGHB__');
			M()->execute('TRUNCATE __SAOLEI_PEIFU__');
			M()->execute('TRUNCATE __SAOLEI_USERFA__');
			M()->execute('TRUNCATE __SAOLEI_USERFALIST__');
			M()->execute('TRUNCATE __USER_CHONGZHI__');
			M()->execute('TRUNCATE __USER_HB__');
			M()->execute('TRUNCATE __USER_LIST__');
			M()->execute('TRUNCATE __USER_TIXIAN__');
			M()->execute('TRUNCATE __USER_YONGJIN__');
			M()->execute('TRUNCATE __USER_ZHANGHU__');
			M()->execute('TRUNCATE __SYS_LOG__');
			M()->execute('TRUNCATE __CHECKIN__');
			$_var_3['code'] = 2;
		} else {
			$_var_3['code'] = 1;
		}
		$this->ajaxReturn($_var_3, 'json');
	}
}